package com.WebProject.mapper;

import com.WebProject.dao.BaseDao;
import com.WebProject.pojo.*;
import org.apache.ibatis.session.SqlSession;

import java.util.ArrayList;


public class AdminMapperImpl extends BaseDao implements AdminMapper {

    private static SqlSession sqlSession = getConntion();
    private AdminMapper Adminsmapper = sqlSession.getMapper(AdminMapper.class);

    @Override
    public t_car queryAppointCarInfo(String car_number) {

        return Adminsmapper.queryAppointCarInfo(car_number);
    }

    @Override
    public Boolean updateAppointCarInfo(t_car car) {
        Boolean aBoolean = Adminsmapper.updateAppointCarInfo(car);
        sqlSession.commit();
        return aBoolean;
    }

    @Override
    public Boolean deleteAppointCar(String car_number) {
        Boolean aBoolean = Adminsmapper.deleteAppointCar(car_number);
        sqlSession.commit();
        return aBoolean;
    }

    @Override
    public ArrayList<t_car_zu> queryAppointUserInfo(Integer user_id) {
        return Adminsmapper.queryAppointUserInfo(user_id);
    }

    @Override
    public ArrayList<t_car_zu> queryAppointAllCarInfo() {
        return Adminsmapper.queryAppointAllCarInfo();
    }

    @Override
    public Boolean addCar(t_car car) {
        Boolean aBoolean = Adminsmapper.addCar(car);
        sqlSession.commit();
        return aBoolean;
    }

    @Override
    public ArrayList<t_car> QueryAllCarInfo() {

        return Adminsmapper.QueryAllCarInfo();
    }

    @Override
    public ArrayList<t_brand> QueryAllBrandInfo() {
        return Adminsmapper.QueryAllBrandInfo();
    }

    @Override
    public ArrayList<t_category> QueryAllCategoryInfo() {
        return Adminsmapper.QueryAllCategoryInfo();
    }
}
